﻿Imports DTO
Public Class DATerminalSetting
    Inherits DataProvider

    Shared Sub ConfigServerName(ByVal serverName As String)

        ' call constructor base class
        ConfigServer(serverName)

    End Sub

    '/******************************************************************/
    '/*             Lay datatable tu DataProvider voi SP               */
    '/******************************************************************/
    Shared Function GetAllTerminalSetting() As DataTable
        Return Query("getAllTerminalSetting")
    End Function
    '/******************************************************************/
    '/*                      Search TerminalSetting                    */
    '/******************************************************************/
    Shared Function SearchTerminalSetting(ByVal groupID As String) As DataTable
        Return Query("searchTerminalSetting", {"@groupID"}, {groupID})
    End Function
    '/******************************************************************/
    '/*                      Delete TerminalSetting                    */
    '/******************************************************************/
    Shared Function DeleteTerminalSetting(ByVal machineID As String) As Integer
        Return Update("deleteTerminalSetting", {"@machineID"}, {machineID})
    End Function
    '/******************************************************************/
    '/*                      Insert TerminalSetting                    */
    '/******************************************************************/
    Shared Function InsertTerminalSetting(ByVal dtoTerminalSetting As DTOTerminalSetting) As Integer
        Return Update("insertTerminalSetting", {"@machineNo", "@useType",
                                                       "@device", "@ipAddress", "@netPortNo",
                                                       "@groupID", "@status",
                                                       "@createDateTime", "@updateDateTime"}, {dtoTerminalSetting.MachineNoProperty, dtoTerminalSetting.UseTypeProperty,
                                                                                               dtoTerminalSetting.DeviceProperty, dtoTerminalSetting.IpAddressProperty,
                                                                                               dtoTerminalSetting.NetPortNoProperty, dtoTerminalSetting.GroupIdProperty,
                                                                                               dtoTerminalSetting.StatusProperty, dtoTerminalSetting.CreateDateTimeProperty,
                                                                                               dtoTerminalSetting.UpdateDateTimeProperty})
    End Function
    '/******************************************************************/
    '/*                      Update TerminalSetting                    */
    '/******************************************************************/
    Shared Function UpdateTerminalSetting(ByVal dtoTerminalSetting As DTOTerminalSetting) As Integer
        Return Update("updateTerminalSetting", {"@machineNo", "@useType",
                                                       "@device", "@ipAddress", "@netPortNo",
                                                       "@groupID",
                                                       "@updateDateTime"}, {dtoTerminalSetting.MachineNoProperty, dtoTerminalSetting.UseTypeProperty,
                                                                                               dtoTerminalSetting.DeviceProperty, dtoTerminalSetting.IpAddressProperty,
                                                                                               dtoTerminalSetting.NetPortNoProperty, dtoTerminalSetting.GroupIdProperty,
                                                                                               dtoTerminalSetting.UpdateDateTimeProperty})
    End Function
End Class
